package com.pactera.miyuangroup.controller.app;

import com.pactera.miyuangroup.filter.CurrentUser;
import com.pactera.miyuangroup.service.ReplenishmentService;
import com.pactera.miyuangroup.vo.response.ResultModel;
import com.pactera.miyuangroup.vo.response.User;
import com.pactera.miyuangroup.vo.response.app.AppReplenishmentListRes;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 描述:
 *
 * @outhor 张汉卿
 * @create 2018-05-02 14:42
 */
@Api(description = "补货清单接口")
@RestController
@RequestMapping("/app/replenishmentlist")
@Slf4j
public class AppReplenishmentListController {

    @Autowired
    private ReplenishmentService replenishmentService;

    @ApiOperation(value = "补货清单接口", notes = "补货清单接口")
    @RequestMapping(value = "/getReplenishmentList", method = RequestMethod.POST)
    private ResultModel<List<AppReplenishmentListRes>> getReplenishmentList(@CurrentUser User user){

        List<AppReplenishmentListRes> list = replenishmentService.getAppNeedReplenishmentList(user.getId());
        return ResultModel.ok(list);
    }
}
